package com.blank.shop.dubbo.config;

import com.alibaba.cloud.dubbo.annotation.DubboTransported;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * <br/>Date 2021/9/1
 * <br/>Time 18:08:12
 *
 * @author _blank
 */
@AutoConfigureAfter(value = {RestTemplateAutoConfiguration.class})
@Configuration
public class RestTemplateConfig {

    @DubboTransported
    @LoadBalanced
    @Bean
    public RestTemplate restTemplate(RestTemplateBuilder restTemplateBuilder) {
        return restTemplateBuilder.build();
    }

}
